{% extends "base.html" %}

{% block mid %}
{#    <div class="col-md-3">#}
{#        <div class="panel panel-default">#}
{#            <div class="panel-heading">#}
{#                选择要管理的帐号#}
{#            </div>#}
{#            <div class="panel-body">#}
{#                {% if accounts|length %}#}
{#                    请点击选择要管理的帐号：<br/>#}
{#                    {% for a in accounts %}#}
{#                        <a href="/account/{{ a.id }}">{{ a.id }}{{ a.account }}</a><br/>#}
{#                    {% endfor %}#}
{#                {% else %}#}
{#                    没有管理的帐号，请点击添加#}
{#                {% endif %}#}
{#            </div>#}
{#        </div>#}
{#    </div>#}
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                登录信息
            </div>
            <div class="panel-body">
                <p>上次登录时间 ： {{ current_user.last_login_time }}</p>
                <p>帐号类型 ： {{ current_user.user_type }}</p>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                管理的帐号
                <div class="pull-right">
                    还可以添加
                    {{ remain }}
                    个帐号　　
                    <a class="btn btn-xs btn-primary" data-toggle="modal" data-target="#add_account_dialog">添加</a>
                </div>
            </div>
            {% if accounts|length %}
                <table class="table table-hover table-bordered">
                    <thead>
                        <tr>
                            <th class="col-md-3">帐号名</th>
                            <th class="col-md-2">帐号状态</th>
                            <th class="col-md-3">操作</th>
                            <th class="col-md-4">添加日期</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% for a in accounts %}
                        <tr>
                            <td>{{ a.account }}</td>
                            <td>{{ a.status }}</td>
                            <td>
                                {% if a.status == 1 %}
                                    <a class="btn btn-xs btn-warning ol-md-2" target="_blank" href="https://mp.weixin.qq.com/">绑定</a>
                                {% else %}
                                    <a class="btn btn-xs btn-success ol-md-2" href="/account/{{ a.id }}" >管理</a>
                                {% endif %}
                            </td>
                            <td>
                                {{ a.add_time }}
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>


            {% else %}
                <p class="list-group-item">没有管理的帐号，请点击添加</p>
            {% endif %}
        </div>
    </div>
{% endblock %}